/**
  ETFAna project, Anyang Normal University && IMP-CAS
  \class ETFMUSIC
  \brief MUlti-Sampling Ionization Chamber
  \author SUN Yazhou, asia.rabbit@163.com
  \since 2024-01-05
  \date 2024-01-05 last modified
  \attention
  changelog
  <table>
  <tr>  <th>Date         <th>Author      <th>Description                   </tr>
  <tr>  <td>2024-01-05   <td>Asia Sun    <td>file created                  </tr>
  </table>

  \copyright Copyright (c) 2021-2024 Anyang Normal U. && IMP-CAS with LGPLv3 LICENSE
*/

#ifndef ETFMUSIC_h
#define ETFMUSIC_h

#include <vector>
#include "ETFDetector.h"

using std::vector;

class ETFMUSIC : public ETFDetector{
public:
  ETFMUSIC(){}
  ETFMUSIC(const char *name);
  virtual ~ETFMUSIC();

  virtual void Initialize() override;
  virtual void Assign(const ETFRawChannel *ch, unsigned uid) override; ///< add a data channel
  virtual void PostAssign() override; ///< finish the processing of all the assigned data
  virtual void Register() override; ///< register hits to the main output tree

  short dE(int i) const; ///< return fdE.de[i]
  double dE() const{ return fdE_; }
  int nunit() const{ return fNUnit; }
  virtual void Print() override;

  // ClassDef(ETFMUSIC, 0);

protected:
  double fdE_; ///< average of all the sampling units
  int fNUnit;
  short *fdE;
};

#endif
